During development, many software developers will utilize dynamic program analysis to analyze and test programs during execution. Traditionally, program event information are collected using instrumented versions of program code being executed; this information may later be analyzed to investigate the execution of the program. Thus, code for the program is instrumented to add additional calls and storage access such that information about events that occur during execution is collected and recorded. However, collection of event information can slowdown execution of the program by adding various time costs of the instrumented code. This slowdown can make program analysis time consuming and, when program interactions are time-sensitive, difficult to control.
Various techniques attempt to deal with slowdown by collecting event information using sampling rate control. Thus, in some techniques, a sampling rate percentage is set between 0% and 100% and sampling of program events is only performed at that rate. However, control of program event information using sampling rate does not necessarily squarely address the issue discussed above, which is slowdown cost of executing instrumented code. While some techniques may assume that sampling rate is related to slowdown, other factors affect slowdown as well, such as introduction of instrumentation during execution, and the relative complexity of the application under test itself. Thus, if a tester is interested in controlling the actual slowdown experienced during testing, the sampling rate provides merely a crude control.